package com.smh.a04FuncationQuoteDemo1;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

public class FunctionDemo2 {
    public static void main(String[] args) {
        //引用静态方法

        ArrayList<String> list=new ArrayList<>();

        Collections.addAll(list,"1","2","3","4","5");

        List<Integer> list1 = list.stream().map(Integer::parseInt).collect(Collectors.toList());
        List<Integer> list2 = list.stream().map(FunctionDemo2::toInteger).collect(Collectors.toList());

        System.out.println(list1);
        System.out.println(list2);


    }
    public static int toInteger(String s){
        return Integer.parseInt(s);
    }
}
